<%@ page import="Trabajo.Compra" %>
<!DOCTYPE html>
<html>
	<head>
          <meta name="layout" content="main">
          <resource:include components="slider" />
	</head>
	<body>
      
			<g:form action="save" >
                            Cantidad:<richui:slider html:type="inline" inputId="cantidad" inputName="cantidad" labels="500" step="0.1" value="${compraInstance.cantidad}" min="0" max="1000" buttons="false" />
                            <hr>
                            <br>
                            Tipo de Madera:
                            <g:select name="tipo" from="${compraInstance.constraints.tipo.inList}" value="${compraInstance?.tipo}" valueMessagePrefix="compra.tipo"/>
                            <br><br>
                            <hr>
                            <br><br>
                            <g:actionSubmit class="save" action="save" value="poner En carrito" />
                            <g:actionSubmit class="show" action="show" value="Ver Factura" />
                            <br><br>
			</g:form>
		</div>
                <script>
                  document.getElementById('cantidad').readOnly=true
                  </script>
                  <table>
          <thead>
                  <tr>

                          <g:sortableColumn property="tipo" title="${message(code: 'compra.tipo.label', default: 'Tipo')}" />

                          <g:sortableColumn property="cantidad" title="${message(code: 'compra.cantidad.label', default: 'Cantidad')}" />
                          <g:sortableColumn property="cantidad" title="${message(code: 'compra.precio.label', default: 'Total')}" />
                  </tr>
          </thead>
          <tbody>            
          <g:each in="${compraInstanceList}" status="i" var="compraInstance">
                <tr>
                        <td><g:link action="show" id="${compraInstance.id}">${fieldValue(bean: compraInstance, field: "tipo")}</g:link></td>
                        <td>${fieldValue(bean: compraInstance, field: "cantidad")}</td>
                        <td>${compraInstance.precio}</td>
                </tr>
           </g:each>
                                <tbody> 
                                  </table>
	</body>
</html>